package com.play.game.mymvp;

import android.os.Bundle;
import android.widget.ListView;
import android.widget.Toast;

import com.play.game.mymvp.presenter.GrilPresenter;
import com.play.game.mymvp.view.BaseActivity;
import com.play.game.mymvp.view.IGirlView;

import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;

public class MainActivity extends BaseActivity<IGirlView,GrilPresenter<IGirlView>> implements IGirlView {

    @BindView(R.id.lv)
    ListView lv;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ButterKnife.bind(this);


        grilPresenter.fetch();


    }

    @Override
    protected GrilPresenter<IGirlView> creatPresenter() {
        return new GrilPresenter<>();
    }


    @Override
    public void showLoading() {
        Toast.makeText(MainActivity.this, "加载成功", Toast.LENGTH_SHORT).show();
    }

    @Override
    public void showGrils(List<Bean.DataBean> list) {
        MyAdapter myAdapter = new MyAdapter(this, list);
        lv.setAdapter(myAdapter);


    }


}
